#ifndef _MOZ_PROFILE
#define _MOZ_PROFILE

#include <string>
#include <list>
#include <stdio.h>

class moz_profile_data
{
public:	
	moz_profile_data();

	std::string const get_name() const;
	std::string const get_command_filename() const;
	std::string const get_data_filename() const;

	moz_profile_data const operator=(moz_profile_data const&);
	bool init_from(std::string& _data_string, const char _delim);

	friend std::ostream& operator << (std::ostream& ost, moz_profile_data const& c);

	static const unsigned short PROPERTIES = 3;

private:

	std::string line_name;
	std::string moz_command_filename;
	std::string moz_related_datafile;

};


class moz_profile_dispatch
{
public:	
	//moz_profile_dispatch(std::string const& _filename);
	//moz_profile_dispatch(const char* filename);

	moz_profile_dispatch(const char* filename, int _profile_id);
	moz_profile_dispatch(std::string const& _filename, int _profile_id);

	void dispatch(FILE** file, std::string const& _connection_str) const;

	static const char DELIMITER;
	static const char COMMENT;

	friend std::ostream& operator << (std::ostream& ost, moz_profile_dispatch const& c);		
	
private:

	unsigned int profile_id;
	std::list< moz_profile_data > _profile_dispatch_list;

	bool parse(const char* filename, int _profile_id);
	bool init_from(const char* filename, int _profile_id);
	bool init_from(std::string const& _filename, int _profile_id);

	//unsigned int query_profile(const char* filename);


	bool empty();
	
};

#endif
